<?php 

$id = $_GET['id'];

include '../function.php';
// 链接数据库
$link = @new mysqli("127.0.0.1", "root", "", "school");

// 判断是否链接成功
if ($link->connect_errno) {

	echo $link->connect_error;

}
// 设置编码
$link->query("set names utf8");

$sql = "select * from stu where id = 3";

$stmt = $link->prepare($sql);


if (!$stmt) {

	printf("<b>发生错误:</b>%s", $link->error);
} else {
	// $stmt->bind_param("s", $id); //绑定参数
	if ($stmt->execute()) {
		$stmt->bind_result($col1);

	    /* fetch values */
	    while ($stmt->fetch()) {
	        printf($col1);
	    }
	} else {
		printf("错误代码:%s,<br/>错误内容:%s", $stmt->errno,$stmt->error);
	}
	$stmt->close();
	$link->close();
	}












 ?>